<template>
    <div>
        <div class="row justify-content-center">
            <div class="col-md-2">
                <b-img rounded="circle" style="width:100%;height:width" :src="msg.icon"></b-img>
                <h6 style="text-align:center">{{msg.name}}</h6>
            </div>
            <div class="col-md-10">
<!--                <div v-for="(m,index) in msgs" :key="index"><strong >{{m}}</strong><br><br><br></div>-->
                <strong >{{msg.text}}</strong><br>
                <b-img thumbnail v-image-preview style="width:30%" v-for="(photo, index) in photos" :key="index" :src="photo"></b-img>
            </div>
        </div>
    <hr>
    </div>
</template>

<script>
    export default {
        name: "workOrderLIst",
        props:['msg'],
        computed:{
            // icon(){
            //     if (this.msg.icon){
            //         return this.GLOBAL.BASE_URL + this.msg.icon;
            //     } else {
            //         return 'img/theme/team-4-800x800.jpg';
            //     }
            // },
            photos(){
                if (this.msg.photos){
                    let res = [];
                    for (var i = 0; i < this.msg.photos.length; i++){
                        res[i] = this.GLOBAL.BASE_URL + this.msg.photos[i];
                    }
                    return res;
                } else {
                    return [];
                }
            },
            msgs(){
                let ret = [];
                let i = this.msg.text.indexOf("【评价分割标记】");
                if (i === -1)
                {
                    ret[0] = this.msg.text;
                } else {
                    ret[0] = this.msg.text.substring(0,i);
                    ret[1] = this.msg.text.substring(i+8);
                }
                return ret;
            }
        }
    }
</script>

<style scoped>

</style>
